package com.ai;

import com.ai.service.MockWeatherService;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Description;

import java.util.function.Function;


/**
 * @program: springboot3-demos
 * @description:
 * @author: Reagan Li
 * @create: 2024-06-12 14:59
 **/

@SpringBootApplication
public class FunctionApplication {

    public static void main(String[] args) {
        SpringApplication.run(FunctionApplication.class, args);
    }

    @Configuration
    static class Config {
        @Bean
        @Description("Get the weather in location") // function description
        public Function<MockWeatherService.Request, MockWeatherService.Response> weatherFunction() {
            return new MockWeatherService();
        }
    }

}
